<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>title</title>
</head>
<body>
<div id="app">
    <button v-on:click="addCount">点我count++</button>
    <br/>
    <h2>count：{{count}}</h2>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const app=new Vue({
        el:"#app",
        data:{
            count:0
        },
        methods:{ //用来定义事件
            addCount:function (){
                this.count++;
            }
        }

    });
</script>
</body>
</html>